package com.IntelligentCommunity.deploy.api.factory;

import com.IntelligentCommunity.common.core.domain.R;
import com.IntelligentCommunity.deploy.api.DeployAlarmRemote;
import com.IntelligentCommunity.deploy.domain.DeployAlarm;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author 美国五星上将麦克阿瑟
 */
@Component
public class DeployAlarmFallbackFactory implements FallbackFactory<DeployAlarmRemote> {
    @Override
    public DeployAlarmRemote create(Throwable cause) {
        return new DeployAlarmRemote() {
            @Override
            public R alarmAdd(DeployAlarm deployAlarm) {
                return R.fail();
            }

            @Override
            public R alarm2mq(DeployAlarm deployAlarm) {
                return R.fail();
            }
        };
    }
}
